<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>利用闭包做加减乘除</title>
	</head>
	<body>
		<input type="text" id="text" value="" />
		<input type="button" id="" value="计算" onclick="showshu()"/>
		<script type="text/javascript">
			function get(){
				txt=document.getElementById("text").value;
				function jisuan(){
					alert(eval(txt));
				}
				return jisuan;
			}
			var n=get();
			function showshu(){
				
				get();
				n();
			}
		</script>
	</body>
</html>
